package com.zlsy.springbootdemo.mt.reward;

/**
 * @author zhouliang
 * @date 2021/1/22 15:20
 */
public class RewardContext {
  private RewardStrategy strategy;

  public RewardContext(RewardStrategy strategy) {
    this.strategy = strategy;
  }

  public void doStrategy(long userId) {
    int rewardMoney = strategy.reward(userId);
    strategy.insertRewardAndSettlement(userId, rewardMoney);
  }
}
